$(function(){
	
	$.getJSON("../data/list_shop.json",function(res){
		var res = res;
		var str ="";
		var Goodscookie = $.cookie("goods");
		var Allgoodscookies=JSON.parse(Goodscookie);
		
		if(Allgoodscookies==null){
			$(".letsgoshoping").css({"display":"block"})
 			$(".biaoge").css({"display":"none"})
		}else{
			var l = Allgoodscookies.length;
			for(var i=0;i<l;i++){
				
				str+=`
					<tr>
						<td class="td1"><input type="checkbox"/>`+Allgoodscookies[i].id+`</td>
						<td class="td2"><img src="`+res[Allgoodscookies[i].id].big_img+`"/></td>
						<td class="td3">`+res[Allgoodscookies[i].id].formation+`</td>
						<td class="td4">`+res[Allgoodscookies[i].id].pric[0]+`</td>
						<td class="td5"><input type="button" value="-"><input type="text" value="`+Allgoodscookies[i].num+`"/><input type="button" value="+"/></td>
						<td class="td6">`+"￥"+(res[Allgoodscookies[i].id].pric[0]*Allgoodscookies[i].num)+`</td>
						<td class="td7"><input type="button" value="删除"/></td>
					</tr>
				`
			}
		}
		$("#tbody1").append(str);
		
		
			$(".td7").click(function(){
				$(this).parent().remove();
			
			})
		
		
		
	})
	
	
	
	
	
	
})

